<style lang="scss" scoped>
	.content {
		width: 100%;
		background-color: white;
		
		padding:30rpx 25rpx;
	}

	.list {
		
		border-bottom: 1px solid #ccc;
		align-items: flex-start;
		padding:25rpx 0;
		.red {
			transform: translateY(6rpx);
		}

		.textarea {
			width: 550rpx;
			height: 120rpx;
			font-size: 28rpx;
		}

		.mic {
			height: 120rpx;
			width: 80rpx;
			border-left: 1px solid #ccc;
			padding-left: 20rpx;
		}

		.ipt,.picker {
			width: 550rpx;
			text-align: right;
		}

		.uploadfile {
			width: 550rpx;

			.btns {
				width: 100%;
				justify-content: flex-end;
				.btn {
					padding:0 30rpx;
					height: 64rpx;
					opacity: 1;
					background: #fffefe;
					border: 2rpx solid #409eff;
					border-radius: 34rpx;
				}
			}
		}

		.record {
			width: 550rpx;
		}
	}
	.line2{
		width:100%;
		border-bottom: 1px solid #ccc;
		line-height:80rpx ;
		.line{
			width:100%;
			
			.t2{
				width:60%;
			}
		}
	}
	.footer {
		height: 160rpx;
	
		background-color: white;
	
	}
</style>

<template>
	<view class="content">
		<view class="f34 bold" style="padding:0 30rpx;border-bottom: 1px solid #ccc;padding-bottom: 20rpx;">操作处理</view>
		<view class="list between-flex f28">
			<view class="align-flex  gray">
				<span class="red">*</span>处理状态
			</view>
			<view class="picker textColor ">
				转交 
			</view>
		</view>
		<view class="list between-flex f28">
			<view class="align-flex  gray">
				<span class="red">*</span>转交人
			</view>
			<view class="picker blue choosearea" @click="$navTo(PagesCourseRouterConfig.ChoosePerson+'?type=2')">
				{{transferUser?transferUser.name:'请选择'}}<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
		<view class="list between-flex f28">
			<view class="align-flex p-left10 gray">
				转交说明
			</view>
			<textarea class="textarea"  v-model="explan" placeholder="请填写" />
		</view>
		
		<view class="footer center-flex">
			<view  class="lbtn" @click="submit">
				提交
			</view>
			
		</view>
	</view>
</template>

<script>
	import PagesCourseRouterConfig from '@/pagesCourse/routerConfig.js'
	export default {
		props: {
			taskId: {
				default: 0
			},
			type: {
				default: 1 //1主任务2子任务
			}
		},
		data() {
			return {
				PagesCourseRouterConfig,
				head: this.$head,
				transferUser:null,
				explan:''

			}
		},
		created() {
			uni.$on('choosePerson', (data) => {
				
					this.transferUser=data
				
			})
		},
		beforeDestroy() {
			uni.$off('choosePerson')
		},
		methods: {
		
			submit() {
				if(!this.transferUser){
					this.$msg('请选择转交人')
				}
				this.$showloading()
				this.$pop.ajaxPost('/bus/taskInfo/transfer', {
					taskId: this.taskId,
					transferUser:this.transferUser.value,
					explan: this.explan
				}).then((res) => {
					uni.hideLoading()
					if (res.code == 0) {
						this.$msg('操作成功')
						
						if(this.type==1){
							uni.navigateBack()
						}else{
							
							this.$emit('submit')
						}
						
					} else {
						this.$msg(res.msg)
					}
				})
				
			},


		}
	}
</script>
